<tagLib name="html" />
{$header}
<div id="main" class="main" >
<!-- 主体内容  -->
<div class="content" >
  
<!--  功能组区域  -->
<div class="btn-toolbar">
      <div class="btn-group">
    <button class="btn btn-primary" onclick="sample_got()"><i class="icon-envelope icon-white"></i>货前样收到</button>
  	<button class="btn btn-primary" onclick="test_loginfo()"><i class="icon-question-sign icon-white"></i> 货前样送检</button>
  	<button class="btn btn-primary" onclick="goods_test_loginfo()"><i class="icon-question-sign icon-white"></i> 货物送检</button>
  	<button class="btn btn-primary" onclick="ok_in()"><i class="icon-ok-sign icon-white"></i> 入库</button> 
    <button class="btn btn-primary" onclick="no_in()"><i class="icon-remove icon-white"></i> 拒绝入库</button>
    </div>
    <form class="search-form pull-right" method='get' action="__URL__">
        {:configList( C('buyStatus'),$_REQUEST['status'] )}
        <input type="text" class="search-query span3" name="supplier" <notempty name='_REQUEST.supplier'>
                    <php>echo 'value="'.urldecode($_REQUEST['supplier']).'"'</php><else/>
                    placeholder="供应商"
                </notempty>
                >
              <input type="text" class="search-query span4" name="keywords" <notempty name='_REQUEST.keywords'>
                    <php>echo 'value="'.urldecode($_REQUEST['keywords']).'"'</php><else/>
                    placeholder="采购单号，产品中文，英文，CAS"
                </notempty>
                >
                <input type="submit" class="btn btn-primary" value="搜索">
          </form>
    <form class="search-form pull-right" method='post' action="__URL__">
        <input type="text" class="search-query span3" name="order_detail_mano" <notempty name='_REQUEST.order_detail_mano'>
                    <php>echo 'value="'.urldecode($_REQUEST['order_detail_mano']).'"'</php><else/>
                    placeholder="销售订单分号"
                </notempty>
                >
                <input type="submit" class="btn btn-primary" value="搜索销售订单分号">
    </form>    
  
  </div>
<!-- 功能组区域结束 -->
<php>
    function getMano($oid){
      return getModelName($oid,'Order_detail','mano');
  }
   function getPo($order_detail_id){
	$order_id = getModelName($order_detail_id,'Order_detail','order_id');
	if($order_id)
  		return getModelName($order_id,'Order','po'); 
	else
 		return;
  }
</php>
<!-- 列表显示区域  -->
<div class="list" >
  <div class="btn-toolbar">
  <div class="btn-group">
    <?php $ods = C('buyStatus'); ?>
  <foreach name="ods" item="vo">
      <if condition="($key gt 1) ">
        <a href="__URL__/index/status/{$key}" class="btn"><i class="icon-th-list"> </i>{$vo}</a>
      </if>
    </foreach>
  </div>
</div>
<div id="result" class="result none"></div><html:list id="checkList" style="table table-bordered table-striped" name="action" checkbox="true" action="true" datasource="list" show="id:编号|5%:edit,mano:采购单号,order_detail_id|getMano:销售订单分号,order_detail_id|getPo:PO,order_detail_id|getMsgTip:备注,product_id|getModelName=Product:产品,product_id|getPename:英文名,product_id|getCas:CAS,supplier_id|getModelName=Supplier:供应商,sample_qc_status|getConfigVal='sampleQcStatus':货前样质量管理,in_qc_status|getConfigVal='inQcStatus':入库质量管理,analysis_sheet|get_patent:分析单,number:数量,charge_man|getModelName=User:负责人,receive_user|getModelName=User:收货人,create_time|toDate:采购时间,receive_time|toDate:收货时间,receive_number:收货数量,status|getConfigVal=buyStatus:状态" actionlist="edit:详情:id" />
</div>
<!--  分页显示区域 -->
<div class="page">{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>
<!-- 主页面结束 --><include file="Public:footer"/>
<script type="text/javascript">
  function fastadd(){
    location.href=URL+"/fastadd";
  }

  function quicksale(id){
    var keyValue;
    if (id)
    {
      keyValue = id;
    }else {
      keyValue = getSelectCheckboxValues();
    }
    if (!keyValue)
    {
      alert('请选择入库单！');
      return false;
    }
    location.href=APP+"/Sale/fastadd/enter_id/"+keyValue;
  }

  function test_loginfo(id){
  var keyValue = (id)? id : getSelectCheckboxValues();
  if (keyValue=='')
  {
    alert('请选择采购单！');
    return false;
  }
  location.href = URL+"/sample_test_loginfo/id/"+keyValue;
 }

  function sample_got(id){
  var keyValue = (id)? id : getSelectCheckboxValues();
  if (keyValue=='')
  {
    alert('请选择采购单！');
    return false;
  }
  location.href = URL+"/sample_got/id/"+keyValue;
 }

 function goods_test_loginfo(id){
  var keyValue = (id)? id : getSelectCheckboxValues();
  if (keyValue=='')
  {
    alert('请选择采购单！');
    return false;
  }
  location.href = URL+"/goods_test_loginfo/id/"+keyValue;
 }

 function ok_in(id){
  var keyValue = (id)? id : getSelectCheckboxValues();
  if (keyValue=='')
  {
    alert('请选择采购单！');
    return false;
  }
  location.href = URL+"/in_house/id/"+keyValue;
 }

function no_in(id){
  var keyValue = (id)? id : getSelectCheckboxValues();
  if (keyValue=='')
  {
    alert('请选择采购单！');
    return false;
  }
  location.href = URL+"/no_house/id/"+keyValue;
 }

</script>

